home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
basic
/
dialogic.zip
/
DEMO.BAS
next >
Wrap
BASIC Source File
|
1990-01-31
|
12KB
|
351 lines
'
'┌───────────────────────────────────────────────────────┐
'│ Written by Jonathan S. Waldman │
'│ (C) 1989, 1990 Jonathan S. Waldman & Dialog Software │
'│ (C) Crescent Software. │
'│ All rights reserved. │
'└───────────────────────────────────────────────────────┘
DEFINT A-Z
DECLARE SUB ByeBye ()
DECLARE SUB DiaLogic (DB() AS ANY, LB() AS ANY, Action, Focus, Ky$)
DECLARE SUB ReDoScr ()
DECLARE SUB Rollover ()
DECLARE SUB Marquee (X$, Row, Colr)
'$INCLUDE: 'DIALOGIC.BI'
DIM SHARED Ky$, HasColor, c1, c2, c3, c4, c5, c6, c7
CALL InitMouse(X) 'initialize the mouse
CALL TextCursor(0, 4) 'initialize the text cursor
CALL HideCursor 'hide the cursor
WIDTH , 25 'set screen to 25-line mode
CLS
PLAY "L64<EC>"
INPUT "Do you have a color monitor (Y/N)"; a$
c1 = 112
c4 = 127
c6 = 15
IF LEFT$(UCASE$(a$), 1) = "Y" THEN
HasColor = -1
c2 = 113
c3 = 2
c5 = 1
c7 = 10
c8 = 14
ELSE
HasColor = 0
c2 = 112
c3 = 7
c5 = 0
c7 = 15
c8 = 7
END IF
COLOR , c5 'set a background
CLS 'clear the screen
COLOR c6
LOCATE 2, 1
PRINT " DiaLogic Demo - A powerful and elegant dialog box utility for QuickBASIC"
PRINT " Version 1.4E - January 31, 1990"
PRINT " "; STRING$(75, 196)
COLOR c8
PRINT " Dialog Software"
PRINT " Box 9889 at 1101 Wilson Boulevard"
PRINT " Arlington, Virginia 22209-0889"
PRINT " "; STRING$(75, 196)
PRINT
PRINT " (703) 528-1505 Questions and general information."
PRINT " Best time to reach a technician: 8:30 a.m. to 11:30 a.m."
PRINT " If a technician is not available, calls are returned on a"
PRINT " collect-basis only. Written comments or questions are"
PRINT " welcome."
PRINT
PRINT " - a l s o -"
PRINT
PRINT " 1-800-DIALOG-1 Order line only."
PRINT " 1-800-342-5641"
PRINT
PRINT " Copyright (C) 1989, 1990 Jonathan S. Waldman & Dialog Software."
PRINT " All rights reserved."
LOCATE 24, 1
COLOR c7 + 16: PRINT "<"; : COLOR c6
PRINT " Press any key to view demo "; : COLOR c7 + 16: PRINT ">"; : COLOR 15, 0
DO
LOOP UNTIL INKEY$ <> ""
CLS
COLOR 8, 7 'set backdrop color
PRINT STRING$(2000, 176); 'print backdrop character
LOCATE 25, 1
PRINT STRING$(80, 176);
RANDOMIZE (INT(TIMER)) 'get a random number; use clock as seed
CALL ShowCursor 'show the mouse cursor
ReDoScr 'color the screen nicely
DO
LOOP UNTIL INKEY$ = ""
'$DYNAMIC 'make use of dynamic arrays
Level% = 1 'set Level to 1
REDIM SHARED DB(2, 20) AS DialogType 'REDIM our arrays
REDIM SHARED LB(55) AS DialogText
DO
LOOP UNTIL INKEY$ = ""
'$INCLUDE: 'Dialog1.db' 'define the first template
DiaLogic DB(), LB(), 0, 3, Ky$ 'call DiaLogic
ReDoScr 'change the background
'$INCLUDE: 'Dialog20.db' 'most of these calls to DiaLogic
DiaLogic DB(), LB(), 0, 0, Ky$ 'follow the same form . . .
ReDoScr 'we keep the same arrays active
'and keep Level at 1
'$INCLUDE: 'Dialog2.db'
DiaLogic DB(), LB(), 0, 0, Ky$
ReDoScr
'$INCLUDE: 'Dialog3.db'
DiaLogic DB(), LB(), 0, 0, Ky$
ReDoScr
'$INCLUDE: 'Dialog4.db'
DiaLogic DB(), LB(), 0, 0, Ky$
ReDoScr
'This shows how to modify the look of a dialog box
'by using PRINT statements from the calling program.
'first, call DiaLogic with an
'$INCLUDE: 'Dialog5.db' 'Action of 1
CALL HideCursor 'remember this step! It will pre-
DiaLogic DB(), LB(), 1, 0, Ky$ 'vent the mouse cursor from leaving
'a mark on the screen after printing
LOCATE 14, 25
PRINT "Select those words which are both";
LOCATE 15, 25
PRINT "correctly-spelled last names of";
LOCATE 16, 25
PRINT "music composers and nouns in";
LOCATE 17, 25
PRINT "the English language.";
CALL ShowCursor 'turn the cursor back on
DiaLogic DB(), LB(), 7, 0, Ky$ 'call DiaLogic again with Action 7
REDIM SHARED LB(30) AS DialogText 'clear and REDIM the LB() array
Level% = 2 'set Level to 2 for a stack dialog box
'$INCLUDE: 'Dialogg.db'
IF Ky$ <> CHR$(27) THEN
IF Ky$ = CHR$(13) AND DB(1, 4).Default = 0 AND DB(1, 5).Default = 0 AND DB(1, 6).Default = -1 THEN
'correct answers were selected
LB(1).Text = "You are correct!" 'define LB() element number one
DB(2, 2).NumberTwo = 1 'set the number of lines in the message
DiaLogic DB(), LB(), 0, 0, Ky$ 'call DiaLogic at Level 2 w/ Action 0
ELSE
LB(1).Text = "Sorry ..." 'if incorrect, print the correct
LB(2).Text = "" 'answers
LB(3).Text = "John Cage is a modern expressionist"
LB(4).Text = "composer. Philip Glass is a modern"
LB(5).Text = "minimalist composer."
DB(1, 2).NumberTwo = 5 'set 5 as highest LB() element
DiaLogic DB(), LB(), 0, 0, Ky$ 'for this list box
END IF
END IF
DiaLogic DB(), LB(), 5, 0, Ky$ 'remove the Level-2 dialog box
ReDoScr
Level% = 1
'$INCLUDE: 'Dialog6.db'
DiaLogic DB(), LB(), 1, 0, Ky$
LOCATE 14, 10
PRINT "Cluster One"
LOCATE 14, 31
PRINT "Cluster Two"
LOCATE 14, 52
PRINT "Cluster Three"
DiaLogic DB(), LB(), 7, 0, Ky$
DiaLogic DB(), LB(), 5, 0, Ky$
ReDoScr
CALL Rollover
CALL ByeBye
END
REM $STATIC
SUB ByeBye
COLOR 7, 0
CALL HideCursor
CLS
COLOR 15
PRINT
PRINT " "; STRING$(75, 196)
COLOR 7
PRINT " DiaLogic is extremely powerful and for this reason this demo can not"
PRINT " be exhaustive. You should know that all text boxes, list boxes, check"
PRINT " boxes, and option buttons can be refreshed on-the-fly to reflect new"
PRINT " information."
COLOR 15
PRINT " "; STRING$(75, 196)
PRINT
COLOR 7
PRINT " Thank you for reviewing DiaLogic. Remember that you have a QB 4.x-"
PRINT " compatible DiaLogic Quick Library (included with this ZIP file). This will"
PRINT " allow you to experiment with the actual DiaLogic program while in the"
PRINT " environment. If you decide you like the program, you may order it by"
PRINT " calling the toll-free number below. For $79.95, registered users will"
PRINT " receive commented BASIC source code; DiaLogic.LIB, which allows stand-"
PRINT " alone .EXE files to be created; the latest version; a printed user's"
PRINT " manual; and technical support."
COLOR 15
PRINT
PRINT " (c) 1989, 1990 Dialog Software. All rights reserved."
PRINT " Orders: 1-800-342-5641. Other Info: 1-703-528-1505."
COLOR 7
PRINT
PRINT " See ORDERFRM.TXT for an actual order form with full order information.";
X$ = INPUT$(1)
CLS
END SUB
SUB Marquee (X$, Row%, Colr%) STATIC
STATIC P% 'remembers the current position between calls
H% = POS(0) 'save the current cursor position
V% = CSRLIN
L% = LEN(X$) 'we need to know the length
P% = P% + 1 'advance to the next character
IF P% > L% THEN P% = 1 'wrap around at the end
LOCATE Row%, 40 - L% \ 2
CALL MQPRINT(RIGHT$(X$, L% - P% + 1) + LEFT$(X$, P% - 1), Colr%)
LOCATE V%, H% 'restore